include("src/framework/jssunit-framework.js");

//Static fixture
var withCompleteSetUpFixture = {
	TestFixtureSetUp: function() {
		this.count = 0;
	},	
	TestFixtureTearDown: function() {
		this.count = 0;
	},
	SetUp : function() {
		this.count++;		
	},	
	TearDown : function() {
		this.count--;		
	},	
	Count_is_1: function() {
		Assert.AreEqual(this.count,1);
	}	
}

//Class like fixture
var classFixture = function() {
}
classFixture.prototype = {
	value_Equal_1: function() {
		Assert.AreEqual(1,1);
	}
}

var successFixture = {
	value_Equal_1: function() {
		var v = 1;
		Assert.AreEqual(1,v);
	},
	value_Equal_A: function() {
		var v = "A";
		Assert.AreEqual("A",v);
	},
	True_is_true: function() {
		Assert.IsTrue(true);
	},
	False_is_false: function() {
		Assert.IsFalse(false);
	},
	Date_instance_is_not_null: function() {
		Assert.IsNotNull(new Date());
	},
	Null_is_null: function() {
		Assert.IsNull(null);
	},
	A_is_not_a_number: function() {
		Assert.IsNaN("A");
	},
	String_is_empty: function() {
		Assert.IsEmpty("");		
	},
	String_is_not_empty: function() {
		Assert.IsNotEmpty("A");
	},
	Method_throws_an_exception: function() {
		Assert.Throws( function() { throw 1; } );
	},
	Allo_contains_ll: function() {
		Assert.Contains("Allo", "ll");
	}
};

var failingFixture = {
	value_Equal_1: function() {
		var v = 2;
		Assert.AreEqual(1,v);
	},
	value_Equal_A: function() {
		var v = "B";
		Assert.AreEqual("A",v);
	},
	True_is_true: function() {
		Assert.IsTrue(false);
	},
	False_is_false: function() {
		Assert.IsFalse(true);
	},
	Date_instance_is_not_null: function() {
		Assert.IsNotNull(null);
	},
	Null_is_null: function() {
		Assert.IsNull(new Date());
	},
	A_is_not_a_number: function() {
		Assert.IsNaN(1);
	},
	String_is_empty: function() {
		Assert.IsEmpty("A");		
	},
	String_is_not_empty: function() {
		Assert.IsNotEmpty("");
	},
	Method_throws_an_exception: function() {
		Assert.Throws( function() {} );
	},
	Allo_contains_ll: function() {
		Assert.Contains("Bonjour", "ll");
	}
}
